#ifndef NYU_SCOPE_H_
#define NYU_SCOPE_H_

#include "nyu_common.h"

typedef struct NyuVarData NyuVarData;

typedef struct NyuScopeVarList NyuScopeVarList;
struct NyuScopeVarList {
    NyuVarData **ref;
    NyuScopeVarList *next;
};

typedef struct NyuScope NyuScope;
struct NyuScope {
    NyuScope *parent;
    NyuScopeVarList *scope_var_list;
    NyuTree *blk;
    long target; /* スロットアクセス時のターゲットオブジェクト */
    long argc;
    long argv[NYU_MAX_ARGLEN];
};

NyuScope *nyu_scope_new(NyuScope *parent);

NyuScopeVarList *nyu_scope_var_list_prepend(NyuScopeVarList *list,
                                            NyuVarData **ref);

#endif /* NYU_SCOPE_H_ */
